<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.min.js"></script>
</head>
<body>
    <div id="app">
        <div>
            <input type="text" v-model = "value">
            <button @click = "add">添加</button>
        </div>
        <div>
            <ul>
                <li v-for="l in list">{{l}}</li>
            </ul>
        </div>
    </div>
    <script>
       new Vue({
            el:"#app",
            data:{
                value:'',
                list:[]
            },
            methods:{
                add(){
                    this.list.push(this.value)
                    this.value = ""
                }
            }
        })
    </script>
</body>
</html>